# _*_ coding: UTF-8 _*_
# @Time     : 2021/11/10 18:18
# @Author   : yangshuaishuai
# @Site     : http://www.hzdledu.cn/
# @File     : sy1.py
# @Software : PyCharm

# def foo(a,b):
#     print(a,b)
#     a=3
#     b=4
#     print(a,b)
# a=1
# b=2
# foo(a,b)
# print(a,b)
#
# def f(x,y=[]):
#     for i in range(x):
#         y.append(i*i)
#     print(y)
# f(3,[3,2,1])


# x="a b c d"
# print(",".join(x.split()))

# x = "hello world"
# print(x[::-1])

def foo1(n):
    if n == 1:
        return 1
    else:
        return n + foo1(n - 1)

print(foo1(3))

def foo2(num):
    if num == 1:
        return 1
    else:
        return num * foo2(num-1)
print(foo2(6))